<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增会议文件')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-papers-add">
            <input type="file" webkitdirectory name = "file">
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/papers"
        $("#form-papers-add").validate({
            focusCleanup: true
        });

        function submitHandler() {

            // if ($.validate.form()) {
            //     $.operate.save(prefix + "/add", $('#form-papers-add').serialize());
            // }
            let fileDate = new FormData(document.getElementById("form-papers-add"))
            console.log(fileDate)
            $.ajax({
                type:"post",
                url: prefix+"/add",
                data:fileDate,
                processData:false,
                contentType: false,
                success: function(result) {
                    if (typeof callback == "function") {
                        callback(result);
                    }
                    $.operate.successCallback(result);
                }
            })
        }
    </script>
</body>
</html>